package com.bootdo.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.system.dao.UserAccountMapper;
import com.bootdo.system.domain.UserAccount;
import com.bootdo.system.service.UserAccountService;
import com.github.pagehelper.PageHelper;



@Service("userAccountService")
public class UserAccountServiceImpl implements UserAccountService {
	@Autowired
	private UserAccountMapper mapper;
	
	@Override
	public UserAccount get(Long id){
		return mapper.get(id);
	}
	
	
	@Override
	public UserAccount getByUserId(Long userId){
		return mapper.getByUserId(userId);
	}
	
	
	@Override
	public List<UserAccount> list(Map<String, Object> map){
		PageHelper.startPage(Integer.parseInt(map.get("pageNum").toString()),Integer.parseInt(map.get("pageSize").toString()));
		return mapper.list(map);
	}
	
	
	@Override
	public int save(UserAccount bComments){
		return mapper.save(bComments);
	}
	
	@Override
	public int update(UserAccount bComments){
		return mapper.update(bComments);
	}
	
	@Override
	public int remove(Long id){
		return mapper.remove(id);
	}
	
	@Override
	public int batchRemove( Integer[] ids){
		return mapper.batchRemove(ids);
	}

	@Override
	public Long getUserPoint(Long userId) {
		return  mapper.getUserPoint(userId);
	}

}
